<div id="page">
<div class="page-title" style="z-index: 780;">
	<div class="in" style="z-index: 770;">
			<div class="titlebar" style="z-index: 760;">	<h2>Manage Host</h2> <p>Add & edit Host's info</p></div>
			<div class="clear" style="z-index: 740;"></div>
	</div>
</div>

<div class="content" style="z-index: 730;">
<div class="simplebox grid740" style="z-index: 500;">

	<div class="titleh" style="z-index: 490;">
		<h3>List Host<?php if($find != '') echo ' | Search with "'.$find.'"' ?></h3>
		<div class="shortcuts-icons" style="z-index: 640;">
			<a class="shortcut tips" href="<?php echo $base_url; ?>/host/add" original-title="Add new host">
			<img width="25" height="25" alt="icon" src="<?php echo $static_url ?>img/icons/shortcut/plus.png">
		</a>
		</div>
	</div>
		
		<table class="tablesorter" id="myTable"> 
			<thead> 
				<tr> 
                    <th class="header">Supplier</th> 
					<th class="header">Email</th>
					<th class="header">User Buy</th>
                    <th class="header">Expires</th> 
				</tr> 
			</thead> 
			
			<tbody> 
				<?php
				
				if(!empty($items)){
					$month = date('m-Y');
					foreach($items as $host){
						$style = "";
						if($month == $host['comparedate']){
							$style = " style='background-color:yellow;'";						
						}else{
							$style = "";
						}
						if (intval($host['status']) == 0){
							$style = " style='background-color:red;'";
						}
				?>
				<tr> 
					<td<?php echo $style;?>><div class="context" style="position:relative;"><a href="<?php echo $base_url ?>/host/edit/<?php echo $host['host_id'] ?>" style=""><?php echo $host['supplier'] ?></a>
						<div style="position:absolute; right:0;top:0;z-index:5px;display:none;" class="context_opt" id="context_<?php echo $host['host_id'] ?>">						
						<a title="Delete host account" href="javascript:void(0)" onClick="deleteUser(<?php echo $host['host_id'] ?>)"><img src="<?php echo $static_url ?>/img/icons/sidemenu/trash.png" width="12"></a>						
						</div>
					</div></td> 
					<td<?php echo $style;?>><?php echo $host['mail'] ?></td> 
					<td<?php echo $style;?>><?php echo $host['user'] ?></td> 
                    <td<?php echo $style;?>><?php echo $host['enddate'] ?></td> 
				</tr> 
				<?php
					}
				}
				?>
				
			</tbody> 
		</table>
		<script language="javascript" type="text/javascript">
		$(document).ready(function(){
			$("div[class='context']").hover(
			function(){
				$(this).children(".context_opt").show();
			},
			function(){
				$(this).children(".context_opt").fadeOut('fast');
			});
		});
		</script>
</div>
<?php if(!empty($paginate)): ?>
<ul class="pagination">
<?php echo $paginate; ?>
</ul>
<?php endif; ?>
</div>
</div>